<template>
	<view class="container big-box">
		<top-navigation :isBack="true" bgColor="#17171F" isFix isShow>
			<view slot='center-slot' class="left-slot">
				关于我们
			</view>
		</top-navigation>
		<view class="content">
			<u-parse :content="getContent"></u-parse>
		</view>
	</view>
</template>

<script>
	//在需要加、解码的的文件里引入【注意替换成自己的路径】
	import {
		Base64
	} from '@/utils/plugs/imgOrBase64.js';
	import validate from 'common/js/validate.js';
	import auth from 'common/js/auth.js';
	import globalConfig from '@/common/js/golbalConfig.js';
	// import {
	// 	randomString
	// } from '../../utils/libs.js'
	import base64Arraybuffer from 'base64-arraybuffer'
	export default {
		data() {
			return {
				type: 'user',
				content: ''
			};
		},
		mixins: [auth, globalConfig],

		onLoad(option) {

			this.getStatic()


		},

		computed: {
			getContent() {
				if (this.content == '') {
					return ''
				}
				// var regex = /\s+src="([^"]*)"\s+style="([^"]*)">/g;
				// var match = regex.exec(this.goodsDetail.content);
				if (true) {
					// var src = match[1]; // 获取style属性的值
					// var style = match[2]; // 获取src属性的值
					// console.log("Style:", style);
					// console.log("Src:", src);
					return this.content
				} else {
					return this.content.replace(/style=/g,
						`style="width:100% !important;display:block;" src="${this.host}/`)
				}
			},
		},
		methods: {
			close() {
				console.log('关闭事件');
				this.userShow = false
			},
			open() {
				console.log('打开事件');
			},
			agree() {
				this.checked = ['true']
				this.close()
			},
			// 方法
			async getStatic() {
				let url = '/api/v1/about'
				let {
					code,
					msg,
					data
				} = await this.$getRequest(url)
				if (code == 200) {
					console.log(data.content, '静态资源');
					this.content = data.content
				} else {
					this.$refs.uToast.show({
						message: msg
					})
				}

			},



		},
		watch: {
			'dynacodeData.seconds': {
				handler(newValue, oldValue) {
					if (newValue == 0) {
						clearInterval(this.dynacodeData.timer);
						this.dynacodeData = {
							seconds: 120,
							timer: null,
							codeText: '获取动态码',
							isSend: false
						};
					}
				},
				immediate: true,
				deep: true
			}
		}
	};
</script>

<style>
	/* @import '/common/css/common.css'; */
</style>

<style lang="scss" scoped>
	.bg {
		position: fixed;
		width: 100vw;
		height: 671rpx;
		bottom: constant(safe-area-inset-bottom);
		bottom: env(safe-area-inset-bottom);
	}





	.big-box {
		width: 100vw;
		background: #17171F;
		min-height: 100vh;

		.left-slot {
			color: #FFF;
		}

		.content {
			padding: 40rpx 32rpx;
			color: rgba(255, 255, 255, .8);
			font-size: 28rpx;
		}
	}









	// 横线式输入框
	.find-form {
		width: calc(100% - 84rpx);
		margin: 81rpx auto 0;
		padding: 0rpx 24rpx;
		box-sizing: border-box;
		border-radius: 15rpx;
		position: relative;


		.form-input {
			display: flex;
			align-items: center;
			margin-top: 32rpx;
			padding: 0 16rpx 0 32rpx;
			background: #21202E;
			border-radius: 10rpx;
			height: 100rpx;
			color: #FFF;
			border: 1rpx solid rgba(0, 0, 0, 0.1);

			.location-num {
				font-size: 30rpx;
				margin-right: 10rpx;
			}

			.dynacode {
				// background: linear-gradient(180deg, #FF7D87 0%, #DF0011 100%);
				// border-radius: 60rpx 60rpx 60rpx 60rpx;
				font-size: 24rpx;
				font-weight: 400;
				color: #3ADD8F;
				padding: 16rpx 13rpx;
			}

			.placeholder-img {
				margin-right: 21rpx;
				width: 24rpx;
			}

			.uni-input {
				width: 100%;
				// background: #21202E;
			}

			input {
				padding: 0;

				// font-size: 16px;
				// font-size: 26px;

			}
		}
	}
</style>